package com.css.gitstats.config;

import org.gitlab4j.api.GitLabApi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


@Configuration
public class GitlabConfiguration {

	@Autowired
	private GitlabProperties gitlabProperties;
	
	/**
     * Http 客户端工具
     *
     * 如果有些 API 该Jar工具包未提供，可以用此Http客户端操作远程接口，执行命令
     * @return
     */
	@Bean
	GitLabApi gitLabApi(){
		GitLabApi gitLabApi = new GitLabApi(gitlabProperties.getUrl(), gitlabProperties.getPersonalAccessToken());
        return gitLabApi;
    }

}
